<?php get_header();courses_style();?>

<div class="box" itemscope="" itemtype="http://schema.org/Article">
<?php if ( have_posts() ) : the_post(); ?>
						<div class="box-title"><h1 itemprop="name"><?php echo the_title();?></h1><h2 style="display:none"><?php echo the_title();?></h2></div>
<p>&nbsp;</p>		
				
<p><?php 
$content=get_the_content();
preg_match_all('/<img.*>/i', $content, $matches);

$replaces=array();
if(isset($matches[0]) && count($matches[0])>0){
	foreach($matches[0] as $k=>$v){
		$v=preg_replace('/width=[\'"][0-9]+[\'"]/is','',$v);
		$v=preg_replace('/height=[\'"][0-9]+[\'"]/is','',$v);
		$replaces[]=$v;
	}
	$content=str_replace($matches[0], $replaces,$content);
}

echo do_shortcode($content);?></p>
						
<?php endif;?>			

		<?php wp_gdsr_render_article(46); ?>
		<?php dd_fblike_generate('Like Standard') ?><br />		
		<?php dd_google1_generate('Compact (20px)') ?><br />
		
		 
		<div class="clear20"></div>


<?php 
	$postid=$post->ID;
	$cat=get_the_category($postid);						
	$catid=$cat[0]->cat_ID;
	if($cat[0]->name!='static'){						
?>

	
	<div class="box-title" style="margin-top: 30px;">Các bài viết khác</div> 
<?php 
						wp_reset_query();
					 
					 
					 $args = array(
							'category__in'=>array($catid),
					 		'post__not_in'=>array($postid),
					 		'showposts'=>6
						);						
					 query_posts($args);
					 $i=0;
					 while(have_posts()):the_post();
					 	$i++;
						$price=post_custom('price');
						?>
						
						<div class="box-item">
							<div class="box-image"><a href="<?php echo the_permalink()?>"><img title="<?php the_title();?>" title="<?php the_title();?>" alt="<?php the_title();?>" title="<?php the_title();?>" width="184" src="<?php echo get_site_url().'/'.post_custom('image')?>" /></a></div>
							<div class="box-content">
								<div id="title"><a href="<?php echo the_permalink()?>"><h3><?php the_title();?></h3></a></div>
								<div id="description">
									<?php if(!empty($price)) echo '<b>'.$price.'</b><br />';echo post_custom('description');?>
									
								</div>
							</div>
							<div class="clear"></div>
						</div>	
						<?php if($i%2==0)echo '<div class="clear20"></div>'?>					
						<?php endwhile; ?>

<?php }?>

</div>
<?php get_footer(); ?>